/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package planesimulator.game;

import com.jme.app.BaseGame;
import com.jme.input.InputHandler;
import com.jme.input.KeyBindingManager;
import com.jme.input.KeyInput;
import com.jme.input.action.InputActionEvent;
import com.jme.input.action.KeyInputAction;

/**
 *
 * @author Jakub Klimek 
 */
public class GameInputHandler extends InputHandler {

  MainGame gm;

  class cameraSetAction extends KeyInputAction {

    int cn;

    cameraSetAction(int x) {
      cn = x;
    }

    public void performAction(InputActionEvent evt) {
      gm.setCamera(cn);
    }
  }

  GameInputHandler(MainGame bg) {
    gm = bg;

    addAction(new cameraSetAction(1), "c1", true);
    addAction(new cameraSetAction(2), "c2", true);
    
    KeyBindingManager keyboard = KeyBindingManager.getKeyBindingManager();
    keyboard.set("c1", KeyInput.KEY_F1);
    keyboard.set("c2", KeyInput.KEY_F2);
  }
}
